﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using RN.ERP.Web.OrderService;
using Newtonsoft.Json;
using Fly.Common.Linq;
using Telerik.Web.UI;
using RN.ERP.Web.PersonService;
using System.Text;
using System.Web.Services;
using RN.ERP.Web.EnterpriseService;
using System.Web.UI.HtmlControls;
using RN.ERP.Web.ModelService;

namespace RN.ERP.Web.CA
{
    public partial class CAOrderDetail : BasePage
    {
        EnterpriseServiceClient enterpriseClient = new EnterpriseServiceClient();
        OrderServiceClient orderClient = new OrderServiceClient();
        PersonServiceClient PersonClient = new PersonServiceClient();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                hidGroup.Value = Request.QueryString["group"];//产品组
                hidOrderId.Value = Request.QueryString["orderGuid"];//订单Guid
                ModelService.Tb_Corp_CompanyInfo com = JsonConvert.DeserializeObject<ModelService.Tb_Corp_CompanyInfo>(enterpriseClient.GetCorpInfo(UserInfo.CorpUserGuid, UserInfo.CurrentArea));
                if (com != null)
                {
                    lbCorpName.Text = com.CorpName;
                }
                lbUserName.Text = UserInfo.UserName;

                if (hidGroup.Value == "CA04")//升级
                {
                    List<ModelService.tb_ProductInfo> product = JsonConvert.DeserializeObject<List<ModelService.tb_ProductInfo>>(orderClient.GetProductsByUserGuid(UserInfo.CorpUserGuid, UserInfo.CurrentArea, 1));
                    repOld.DataSource = product;//已购买
                    repOld.DataBind();
                    List<ModelService.tb_ProductInfo> product2 = JsonConvert.DeserializeObject<List<ModelService.tb_ProductInfo>>(orderClient.GetProductsByUserGuid(UserInfo.CorpUserGuid, UserInfo.CurrentArea, 2));
                    repCorp.DataSource = product2;//可升级到
                    repCorp.DataBind();
                    divPerson.Visible = false;
                    if (repCorp.Items.Count > 0 && repOld.Items.Count > 0)
                    {
                        for (int i = 0; i < repCorp.Items.Count; i++)
                        {
                            HiddenField hidSumPay = (HiddenField)repCorp.Items[i].FindControl("hidSumPay");
                            Label lbAddFee = (Label)repCorp.Items[i].FindControl("lbAddFee");
                            lbAddFee.Text = hidSumPay.Value;
                        }
                    }
                    else
                    {
                        ProChoose.Visible = false;
                    }
                    if (repOld.Items.Count == 0)
                    {
                        ProBuy.Visible = false;
                    }
                }
                else if (hidGroup.Value == "CA03" || hidGroup.Value == "CA02")//补办或续费
                {
                    List<ModelService.tb_ProductInfo> product = JsonConvert.DeserializeObject<List<ModelService.tb_ProductInfo>>(orderClient.GetProductsByUserGuid(UserInfo.CorpUserGuid, UserInfo.CurrentArea, 1));
                    repOld.DataSource = product;//已购买
                    repOld.DataBind();
                    repCorp.DataSource = product;
                    repCorp.DataBind();
                    ProChoose.Visible = repCorp.Items.Count > 0;
                    ProBuy.Visible = repOld.Items.Count > 0;
                }
                else//初始办理
                {
                    //绑定企业产品列表
                    ModelService.ProductCondition condition = new ModelService.ProductCondition();
                    if (UserInfo.RoleType == "Manager")
                    {
                        condition = new ModelService.ProductCondition() { Code = new ParameterValue<string>() { V = "C", O = OptEnum.StartWith }, GroupCode = new ParameterValue<string>() { V = hidGroup.Value, O = OptEnum.Equal } };
                    }
                    else if (UserInfo.RoleType == "User")
                    {
                        condition = new ModelService.ProductCondition() { Code = new ParameterValue<string>() { V = "E", O = OptEnum.StartWith }, GroupCode = new ParameterValue<string>() { V = hidGroup.Value, O = OptEnum.Equal } };
                    }
                    List<ModelService.ProductCondition> query = new List<ModelService.ProductCondition>() { condition };
                    string queryStr = JsonConvert.SerializeObject(query);
                    List<ModelService.tb_ProductInfo> product = JsonConvert.DeserializeObject<List<ModelService.tb_ProductInfo>>(orderClient.GetProducts(queryStr, UserInfo.CurrentArea));
                    repCorp.DataSource = product;
                    repCorp.DataBind();
                }
                //修改订单
                if (!string.IsNullOrEmpty(hidOrderId.Value))
                {
                    lbtnEdit.Visible = true;
                    lbtnCreat.Visible = false;
                    //获取订单信息 
                    ModelService.CaPayInfo caPayInfo = JsonConvert.DeserializeObject<ModelService.CaPayInfo>(orderClient.GetOrderInfo(hidOrderId.Value));
                    if (caPayInfo != null)
                    {
                        var caPaySub = caPayInfo.PayInfoSub;
                        ModelService.CaPayInfoSub corpList = caPaySub.Where(c => c.bCAKind.Contains("E") || c.bCAKind.Contains("C")).FirstOrDefault();//企业
                        if (corpList != null)
                        {
                            for (int j = 0; j < repCorp.Items.Count; j++)
                            {
                                HtmlInputCheckBox cbox = (HtmlInputCheckBox)repCorp.Items[j].FindControl("ckCorp");
                                if (cbox.Value == corpList.bCAKind)
                                {
                                    cbox.Checked = true;//企业产品列表绑定已选产品
                                }
                            }
                        }
                    }
                }
                else
                {
                    lbtnEdit.Visible = false;
                    lbtnCreat.Visible = true;
                }
            }
        }

        public string GetNavigateUrl(object EmpId, object Name, object IDCard, object Code)
        {
            string name = HttpUtility.UrlEncode(Name.ToString(), Encoding.UTF8);
            string idCard = HttpUtility.UrlEncode(IDCard.ToString());
            return string.Format("CAProductSelect.aspx?EmpId={0}&Name={1}&IDCard={2}&ProCode={3}&group={4}", EmpId, name, idCard, Code, hidGroup.Value);
        }

        protected void RadGrid1_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
        {
            if (hidGroup.Value != "CA04")//人员产品不能升级
            {
                List<CAPersonPayInfo> list = GetNewPersonList();
                if (!IsPostBack) //第一次加载时把已有产品的人员id存入隐藏域
                {
                    if (!string.IsNullOrEmpty(hidOrderId.Value)) //如果存在人员订单信息（即修改订单），给列表其他信息赋值
                    {
                        ModelService.CaPayInfo caPayInfo = JsonConvert.DeserializeObject<ModelService.CaPayInfo>(orderClient.GetOrderInfo(hidOrderId.Value));
                        if (caPayInfo != null)
                        {
                            ModelService.CaPayInfoSub[] sub = caPayInfo.PayInfoSub;
                            List<ModelService.CaPayInfoSub> empList = sub.Where(c => c.bCAKind.Contains("F") || c.bCAKind.Contains("D")).ToList();//人员
                            for (int i = 0; i < empList.Count; i++)
                            {
                                string code = empList[i].bCAKind;
                                hdnPersonOrders.Value += empList[i].SourceID + "@" + code + ",";
                            }
                        }
                    }
                }
                list = GetNewListByHidValue(list);
                RadGrid1.DataSource = list;
                if (hidGroup.Value == "CA02")//续费时不需要显示费用，只需年费
                {
                    RadGrid1.Columns[4].Visible = false;
                }
                if (hidGroup.Value != "CA03")//只有补办时显示人员的补交费用
                {
                    RadGrid1.Columns[6].Visible = false;
                }
            }
        }

        protected void lbtnCreat_Click(object sender, EventArgs e)
        {
            if ((hidGroup.Value == "CA04" && repCorp.Items.Count <= 0))
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "", "$.ligerDialog.warn('没有可升级产品','',RefreshWin);", true);
            }
            else
            {
                string orderGuid = hidOrderId.Value;
                string corpProductCode = string.Empty;//企业产品code
                string corpSum = string.Empty;//企业总额
                for (int j = 0; j < repCorp.Items.Count; j++)
                {
                    HtmlInputCheckBox cbox = (HtmlInputCheckBox)repCorp.Items[j].FindControl("ckCorp");
                    HiddenField hidSumPay = (HiddenField)repCorp.Items[j].FindControl("hidSumPay");
                    if (cbox.Checked)
                    {
                        corpProductCode = cbox.Value;
                        if (hidGroup.Value == "CA02")//续费只交年费
                        {
                            corpSum = GetProductByCode(corpProductCode).YearlyFee.ToString();
                        }
                        else if (hidGroup.Value == "CA03")//补办交年费+100
                        {
                            corpSum = (GetProductByCode(corpProductCode).YearlyFee + 100).ToString();
                        }
                        else if (hidGroup.Value == "CA04")//升级补差价
                        {
                            corpSum = hidSumPay.Value;
                        }
                        else
                        {
                            corpSum = GetProductByCode(corpProductCode).Fee.ToString();
                        }
                    }
                }
                ModelService.Tb_Corp_CompanyInfo com = JsonConvert.DeserializeObject<ModelService.Tb_Corp_CompanyInfo>(enterpriseClient.GetCorpInfo(UserInfo.CorpUserGuid, UserInfo.CurrentArea));
                ModelService.CaPayInfo caPayInfo = GetData(orderGuid, corpProductCode, corpSum, com);
                if (caPayInfo.PayInfoSub.Length == 0)
                {
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "", "$.ligerDialog.warn('请为企业或人员选择产品','',RefreshWin);", true);
                }
                else
                {
                    string payInfo = JsonConvert.SerializeObject(caPayInfo);
                    ModelService.OperationResult result;
                    if (!string.IsNullOrEmpty(orderGuid))
                    {

                        result = JsonConvert.DeserializeObject<ModelService.OperationResult>(orderClient.EditOrder(payInfo));
                    }
                    else
                    {
                        result = JsonConvert.DeserializeObject<ModelService.OperationResult>(orderClient.AddOrder(payInfo));
                    }
                    if (result.Result)
                    {
                        ScriptManager.RegisterStartupScript(this, this.GetType(), "", "$.ligerDialog.warn('" + result.Message + "','',RedirectWin);", true);
                    }
                    else
                    {
                        ScriptManager.RegisterStartupScript(this, this.GetType(), "", "$.ligerDialog.warn('" + result.Message + "','',RefreshWin);", true);
                    }
                }
            }
        }

        protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)
        {
            if (e.Argument == "RebindAndNavigate")
            {
                RadGrid1.MasterTableView.SortExpressions.Clear();
                RadGrid1.MasterTableView.GroupByExpressions.Clear();
                //RadGrid1.MasterTableView.CurrentPageIndex = RadGrid1.MasterTableView.PageCount - 1;
                List<CAPersonPayInfo> list = GetNewPersonList();//获得初始列表
                list = GetNewListByHidValue(list);
                RadGrid1.DataSource = list;
                RadGrid1.Rebind();
            }
        }

        protected void lbtnChoose_Click(object sender, EventArgs e)
        {
            for (int j = 0; j < repCorp.Items.Count; j++)
            {
                HtmlInputCheckBox cbox = (HtmlInputCheckBox)repCorp.Items[j].FindControl("ckCorp");
                cbox.Checked = false;
            }
            if (hidGroup.Value != "CA04")
            {
                hdnPersonOrders.Value = string.Empty;
                List<CAPersonPayInfo> list = GetNewPersonList();
                list = GetNewListByHidValue(list);
                RadGrid1.DataSource = list;
                RadGrid1.Rebind();
            }
        }

        private ModelService.tb_ProductInfo GetProductByCode(string procode)
        {
            ModelService.ProductCondition condition = new ModelService.ProductCondition() { Code = new ParameterValue<string>() { V = procode, O = OptEnum.Equal } };
            List<ModelService.ProductCondition> query = new List<ModelService.ProductCondition>() { condition };
            string queryStr = JsonConvert.SerializeObject(query);
            List<ModelService.tb_ProductInfo> product = JsonConvert.DeserializeObject<List<ModelService.tb_ProductInfo>>(orderClient.GetProducts(queryStr, UserInfo.CurrentArea));
            ModelService.tb_ProductInfo pro = product.FirstOrDefault();
            return pro;
        }

        /// <summary>
        /// 企业产品订单
        /// </summary>
        /// <param name="orderGuid"></param>
        /// <param name="corpProductCode"></param>
        /// <param name="corpSum"></param>
        /// <param name="com"></param>
        /// <param name="caPayInfoTmp"></param>
        /// <param name="sum"></param>
        /// <returns></returns>
        private List<ModelService.CaPayInfoSub> GetCorpPayinfoSub(
            string orderGuid,
            string corpProductCode,
            string corpSum,
            ModelService.Tb_Corp_CompanyInfo com,
            ModelService.CaPayInfo caPayInfoTmp,
            ref double sum)
        {
            List<ModelService.CaPayInfoSub> capayInfoSub = new List<ModelService.CaPayInfoSub>();

            if (!string.IsNullOrEmpty(corpProductCode))
            {
                ModelService.CaPayInfoSub subCorp = new ModelService.CaPayInfoSub();
                if (!string.IsNullOrEmpty(orderGuid) && caPayInfoTmp != null)
                {
                    subCorp.treeID = caPayInfoTmp.ID;
                }
                subCorp.KeyGUID = Guid.NewGuid();
                subCorp.Title = com.CorpName;
                subCorp.SumPay = double.Parse(corpSum);
                subCorp.bCAKind = corpProductCode;
                subCorp.SourceID = com.ID;
                subCorp.bCAStatus = 0;
                subCorp.RightCode = 1;
                subCorp.FlowCode = "0";
                subCorp.IsDel = false;
                subCorp.bStatus = 0;
                subCorp.btype = 0;
                capayInfoSub.Add(subCorp);
                sum += double.Parse(corpSum);
            }
            return capayInfoSub;
        }

        /// <summary>
        /// 获取订单详细数据
        /// </summary>
        /// <param name="orderGuid"></param>
        /// <param name="corpProductCode"></param>
        /// <param name="corpSum"></param>
        /// <param name="com"></param>
        /// <returns></returns>
        private ModelService.CaPayInfo GetData(
            string orderGuid,
            string corpProductCode,
            string corpSum,
            ModelService.Tb_Corp_CompanyInfo com)
        {
            ModelService.CaPayInfo caPayInfo = new ModelService.CaPayInfo();
            if (!string.IsNullOrEmpty(orderGuid))
            {
                caPayInfo.KeyGUID = Guid.Parse(orderGuid);
            }
            else
            {
                caPayInfo.KeyGUID = Guid.NewGuid();
                caPayInfo.iTitle = com.CorpName;
                caPayInfo.CorpUserGuid = Guid.Parse(UserInfo.CorpUserGuid);
                caPayInfo.AreaCode = com.AreaCode;
                caPayInfo.LinkPerson = com.LinkMan1;
                caPayInfo.SendAddress = com.Address;
                caPayInfo.officeTel = com.Tel;
                //caPayInfo.mobileTel = com.Tel;
                caPayInfo.postcode = com.ZipCode;
                caPayInfo.RegisterDate = DateTime.Now;
                caPayInfo.bCAStatus = 0;
                caPayInfo.RightCode = 1;
                caPayInfo.Code = DateTime.Now.ToString("yyMMddHHmmssff") + "01";
                caPayInfo.FlowCode = "0";
                caPayInfo.bcorpkind = !string.IsNullOrEmpty(com.Type) ? int.Parse(com.Type) : 0;
                caPayInfo.IsDel = false;
                caPayInfo.TransDate = DateTime.Now;
                caPayInfo.GroupCode = hidGroup.Value;
                //Remark
            }
            caPayInfo.OptDate = DateTime.Now;
            if (hidGroup.Value == "CA01")
            {
                caPayInfo.CurrentAreaCode = UserInfo.CurrentArea;
            }
            double sum = 0;
            ModelService.CaPayInfo caPayInfoTmp = new ModelService.CaPayInfo();
            if (!string.IsNullOrEmpty(orderGuid))
            {
                caPayInfoTmp = JsonConvert.DeserializeObject<ModelService.CaPayInfo>(orderClient.GetOrderInfo(orderGuid));
            }
            List<ModelService.CaPayInfoSub> caList = new List<ModelService.CaPayInfoSub>();
            //企业key
            caList.AddRange(GetCorpPayinfoSub(
                orderGuid,
                corpProductCode,
                corpSum,
                com,
                caPayInfoTmp,
                ref sum));

            if (hidGroup.Value != "CA04")
            {
                #region 获取所有人员列表
                List<ModelService.tb_Emp_Manager> managerList = new List<ModelService.tb_Emp_Manager>();
                ModelService.QueryPersonInfoCondition queryCondition = new ModelService.QueryPersonInfoCondition();
                if (UserInfo.RoleType == "Manager")
                {
                    queryCondition.CorpGuid = new ParameterValue<Guid> { V = Guid.Parse(UserInfo.CorpUserGuid), O = OptEnum.Equal };
                }
                else
                {
                    queryCondition.CorpGuid = new ParameterValue<Guid> { V = Guid.Parse(UserInfo.CorpUserGuid), O = OptEnum.Equal };
                    queryCondition.TypeFlag = new ParameterValue<string> { V = "-1", O = OptEnum.Like };
                };
                List<ModelService.QueryPersonInfoCondition> query = new List<ModelService.QueryPersonInfoCondition>() { queryCondition };
                string queryStr = JsonConvert.SerializeObject(query);
                managerList = JsonConvert.DeserializeObject<List<ModelService.tb_Emp_Manager>>(PersonClient.GetEmpManagersAllList(0, 0, queryStr, UserInfo.CurrentArea));
                List<CAPersonPayInfo> list = new List<CAPersonPayInfo>();//获得初始列表
                foreach (var item in managerList)
                {
                    CAPersonPayInfo person = new CAPersonPayInfo();
                    person.ID = item.ID;
                    person.EmpGuid = item.EmpGuid;
                    person.Name = item.Name;
                    person.IDCard = item.IDCard;
                    person.Fee = string.Empty;
                    person.Description = string.Empty;
                    person.YearlyFee = string.Empty;
                    person.Code = string.Empty;
                    list.Add(person);
                }
                list = GetNewListByHidValue(list);
                #endregion
                //人员key
                for (int i = 0; i < list.Count; i++)
                {
                    string empId = list[i].ID.ToString();
                    string empName = list[i].Name.ToString();
                    string sumpay = string.Empty;
                    if (hidGroup.Value == "CA02")
                    {
                        sumpay = list[i].YearlyFee.ToString();
                    }
                    else if (hidGroup.Value == "CA03")
                    {
                        sumpay = string.IsNullOrEmpty(list[i].YearlyFee) ? "" : (double.Parse(list[i].YearlyFee) + 100).ToString();
                    }
                    else
                    {
                        sumpay = list[i].Fee.ToString();
                    }
                    string caKind = list[i].Code.ToString();
                    if (!string.IsNullOrEmpty(sumpay) && !string.IsNullOrEmpty(caKind))
                    {
                        ModelService.CaPayInfoSub subEmp = new ModelService.CaPayInfoSub();
                        if (!string.IsNullOrEmpty(orderGuid) && caPayInfoTmp != null)
                        {
                            subEmp.treeID = caPayInfoTmp.ID;
                        }
                        subEmp.KeyGUID = Guid.NewGuid();
                        subEmp.Title = empName;
                        subEmp.SumPay = double.Parse(sumpay);
                        subEmp.bCAKind = caKind;
                        subEmp.SourceID = int.Parse(empId);
                        subEmp.bCAStatus = 0;
                        subEmp.RightCode = 1;
                        subEmp.FlowCode = "0";
                        subEmp.IsDel = false;
                        subEmp.bStatus = 0;
                        subEmp.btype = 0;
                        caList.Add(subEmp);
                        sum += double.Parse(sumpay);
                    }
                }
            }
            caPayInfo.SumPay = sum;
            //string listsub = JsonConvert.SerializeObject(caList);
            //caPayInfo.PayInfoSub = JsonConvert.DeserializeObject<ModelService.CaPayInfoSub[]>(listsub);
            caPayInfo.PayInfoSub = caList.ToArray();
            return caPayInfo;
        }

        /// <summary>
        /// 根据隐藏域里面的值给列表重新赋值
        /// </summary>
        /// <param name="list"></param>
        /// <returns></returns>
        private List<CAPersonPayInfo> GetNewListByHidValue(List<CAPersonPayInfo> list)
        {
            string hidStr = hdnPersonOrders.Value;
            string[] arr = hidStr.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);
            for (int i = 0; i < arr.Length; i++)//表示共有多少人员添加了产品
            {
                string[] str = arr[i].Split(new string[] { "@" }, StringSplitOptions.RemoveEmptyEntries);
                string empid = str[0];
                string procode = string.Empty;
                if (str.Length > 1)
                {
                    procode = str[1];
                }
                foreach (var item in list) //给列表重新赋值
                {
                    if (item.ID.ToString() == empid && !string.IsNullOrEmpty(procode))
                    {
                        ModelService.tb_ProductInfo pro = GetProductByCode(procode);
                        item.Fee = pro.Fee.ToString();
                        item.Description = pro.Description;
                        item.YearlyFee = pro.YearlyFee.ToString();
                        item.Code = procode;
                    }
                    else if (item.ID.ToString() == empid)
                    {
                        item.Fee = string.Empty;
                        item.Description = string.Empty;
                        item.YearlyFee = string.Empty;
                        item.Code = string.Empty;
                    }
                }
            }
            return list;
        }

        /// <summary>
        /// 获取该企业下人员列表（分页）
        /// </summary>
        /// <returns></returns>
        private List<ModelService.tb_Emp_Manager> BindRadGrid()
        {
            ModelService.QueryPersonInfoCondition queryCondition = new ModelService.QueryPersonInfoCondition();
            if (UserInfo.RoleType == "Manager")
            {
                queryCondition.CorpGuid = new ParameterValue<Guid> { V = Guid.Parse(UserInfo.CorpUserGuid), O = OptEnum.Equal };
            }
            else
            {
                queryCondition.CorpGuid = new ParameterValue<Guid> { V = Guid.Parse(UserInfo.CorpUserGuid), O = OptEnum.Equal };
                queryCondition.TypeFlag = new ParameterValue<string> { V = "-1", O = OptEnum.Like };
            }
            List<ModelService.QueryPersonInfoCondition> query = new List<ModelService.QueryPersonInfoCondition>() { queryCondition };
            string queryStr = JsonConvert.SerializeObject(query);
            int pageCount = RadGrid1.CurrentPageIndex + 1;
            int pageSize = RadGrid1.PageSize;
            RadGrid1.AllowCustomPaging = true;
            RadGrid1.VirtualItemCount = PersonClient.GetEmpManagersAllCount(queryStr, UserInfo.CurrentArea);
            List<ModelService.tb_Emp_Manager> managerList = JsonConvert.DeserializeObject<List<ModelService.tb_Emp_Manager>>(PersonClient.GetEmpManagersAllList(pageCount, pageSize, queryStr, UserInfo.CurrentArea));
            return managerList;
        }

        /// <summary>
        /// 获取新的人员列表（分页）
        /// </summary>
        /// <returns></returns>
        private List<CAPersonPayInfo> GetNewPersonList()
        {
            List<ModelService.tb_Emp_Manager> managerList = BindRadGrid();
            List<CAPersonPayInfo> list = new List<CAPersonPayInfo>();
            foreach (var item in managerList)
            {
                CAPersonPayInfo person = new CAPersonPayInfo();
                person.ID = item.ID;
                person.EmpGuid = item.EmpGuid;
                person.Name = item.Name;
                person.IDCard = item.IDCard;
                list.Add(person);
            }
            return list;
        }

        protected void repCorp_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (hidGroup.Value == "CA03")
            {
                if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
                {
                    Label lbAddFee = (Label)e.Item.FindControl("lbAddFee");
                    Label lbYearlyFee = (Label)e.Item.FindControl("lbYearlyFee");
                    lbAddFee.Text = (double.Parse(lbYearlyFee.Text) + 100).ToString();
                }
            }
        }

        public class CAPersonPayInfo
        {
            public Guid EmpGuid { get; set; }
            public Int32 ID { get; set; }
            public String Name { get; set; }
            public String IDCard { get; set; }
            public String Description { get; set; }
            public String Fee { get; set; }
            public String YearlyFee { get; set; }
            public String Code { get; set; }
        }
    }
}